package singleton.demo1;

import singleton.demo2.JiFactory;
import singleton.demo3.YaFactory;

public class MyRunnable implements Runnable{

    @Override
    public synchronized void run() {
//        XieFactory xieFactory = XieFactory.getInstance();
//        System.out.println(Thread.currentThread().getName() + "获取到的鞋厂为：" + xieFactory);

//        JiFactory jiFactory = JiFactory.getInstance();
//        System.out.println(Thread.currentThread().getName() + "获取到的鸡厂为：" + jiFactory);

        YaFactory yaFactory = YaFactory.getInstance();
        System.out.println(Thread.currentThread().getName() + "获取到的鸭厂为：" + yaFactory);
    }

}
